package com.okyai.qa.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.okyai.qa.mapper.NotesRecordMapper;
import com.okyai.qa.domain.NotesRecord;
import com.okyai.qa.service.INotesRecordService;
import com.okyai.common.core.text.Convert;

/**
 * 答题记录项目Service业务层处理
 * 
 * @author okyai
 * @date 2021-03-19
 */
@Service
public class NotesRecordServiceImpl implements INotesRecordService 
{
    @Autowired
    private NotesRecordMapper notesRecordMapper;

    /**
     * 查询答题记录项目
     * 
     * @param answerId 答题记录项目ID
     * @return 答题记录项目
     */
    @Override
    public NotesRecord selectNotesRecordById(Long answerId)
    {
        return notesRecordMapper.selectNotesRecordById(answerId);
    }

    /**
     * 查询答题记录项目列表
     * 
     * @param notesRecord 答题记录项目
     * @return 答题记录项目
     */
    @Override
    public List<NotesRecord> selectNotesRecordList(NotesRecord notesRecord)
    {
        return notesRecordMapper.selectNotesRecordList(notesRecord);
    }

    /**
     * 新增答题记录项目
     * 
     * @param notesRecord 答题记录项目
     * @return 结果
     */
    @Override
    public int insertNotesRecord(NotesRecord notesRecord)
    {
        return notesRecordMapper.insertNotesRecord(notesRecord);
    }

    /**
     * 修改答题记录项目
     * 
     * @param notesRecord 答题记录项目
     * @return 结果
     */
    @Override
    public int updateNotesRecord(NotesRecord notesRecord)
    {
        return notesRecordMapper.updateNotesRecord(notesRecord);
    }

    /**
     * 删除答题记录项目对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteNotesRecordByIds(String ids)
    {
        return notesRecordMapper.deleteNotesRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除答题记录项目信息
     * 
     * @param answerId 答题记录项目ID
     * @return 结果
     */
    @Override
    public int deleteNotesRecordById(Long answerId)
    {
        return notesRecordMapper.deleteNotesRecordById(answerId);
    }
}
